package com.ruoyi.city.mapper;

import com.ruoyi.city.domain.City;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface CityMapper {

    @Select("SELECT * FROM tb_exam_center_city")
    List<City> selectCityList();

    @Select("SELECT * FROM tb_exam_center_city WHERE id = #{id}")
    City selectCityById(Long id);

    @Select("SELECT * FROM tb_exam_center_city WHERE city_code = #{cityCode}")
    City selectCityByCode(String cityCode);

    @Insert("INSERT INTO tb_exam_center_city (city_code, city_name) VALUES (#{cityCode}, #{cityName})")
    int insertCity(City city);

    @Update("UPDATE tb_exam_center_city SET city_code = #{cityCode}, city_name = #{cityName} WHERE id = #{id}")
    int updateCity(City city);

    @Delete("DELETE FROM tb_exam_center_city WHERE id IN (${ids})")
    int deleteCityByIds(@Param("ids") String ids);
}
